
import 'package:flutter/material.dart';

class HApp extends StatelessWidget{

  @override
  Widget build(BuildContext context) {

    final title = 'Horizontal List';
    return new MaterialApp(
      title: title,
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text(title),
        ),
        body: new Container(
          margin: new EdgeInsets.symmetric(vertical: 20.0),
          height: 200.0,
          child: new ListView(
            scrollDirection: Axis.horizontal,
            children: <Widget>[
              new Container(
                width: 160.0,
                color: Colors.red,
              ),
              new Container(
                width: 160.0,
                color: Colors.blue,
              ),
              new Container(
                width: 160.0,
                color: Colors.green,
              ),
              new Container(
                width: 160.0,
                color: Colors.yellow,
              ),
            ],
          ),
        ),
      ),
    );
  }

}

class MultiList extends StatelessWidget{

  final headStyle = const TextStyle(
      fontWeight: FontWeight.bold,
      color: Colors.yellow
  );

  final msgStyle = const TextStyle(
      fontWeight: FontWeight.normal,
      color: Colors.black38
  );

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'multitype',
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('multi'),
        ),
        body: new ListView.builder(
            itemCount: 18,
            itemBuilder: (context, index){
              if(index % 6 == 0){
                return new ListTile(
                  title: new Text('Head${index}', style: headStyle,),
                );
              }else{
                return new ListTile(
                  title: new Text('msg $index', style: msgStyle,),
                );
              }
            }),
      ),
    );
  }

}